import { fetchPaymentListApi } from '@/api/car/payApi';

const actions = {
  /*发送请求获取停车缴费列表的action*/
  async fetchPaymentListAction(context, params) {
    const { data } = await fetchPaymentListApi(params);
    context.commit('setPaymentListMutation', data);
  },
};
const mutations = {
  /*设置停车缴费列表的mutation*/
  setPaymentListMutation(state, { total, rows }) {
    state.total = total;
    state.paymentList = rows;
  },
};
const state = () => {
  return {
    total: 0,
    paymentList: [],
  };
};

export default {
  actions,
  mutations,
  state,
  namespaced: true,
};
